namespace ScrumSprintMonitor.Infrastructure
{
	#region #using Directives

	using System;

	#endregion

	public interface ITeamMemberAvailableTimeCalculator
	{
		bool HasFreeBusyInformationFor(ITeamMemberInformation teamMemberInfo);
		double GetAvailableHours(ITeamMemberInformation teamMemberInfo, DateTime start, DateTime end, TimeCalculationOptions options);
	}

	public static class TeamMemberAvailableTimeCalculatorExtensions
	{
		public static double GetAvailableHours(this ITeamMemberAvailableTimeCalculator calculator, ITeamMemberInformation teamMemberInfo, DateTime start,
		                                       DateTime end)
		{
			return calculator.GetAvailableHours(teamMemberInfo, start, end, TimeCalculationOptions.FutureOnly);
		}
	}

	public enum TimeCalculationOptions
	{
		FutureOnly,
		PastAndFuture
	}
}